#include <stdio.h>

int main(int argc, char const *argv[])
{
    int n, i0, i1, i2, i3, i4, i5, i6, i7, i8, i9;
    int count = 3, result = 0;
    scanf("%d", &n);


    for (i0 = 1; i0 <= count; i0++)
    for (i1 = 1; i1 <= count; i1++)
    for (i2 = 1; i2 <= count; i2++)
    for (i3 = 1; i3 <= count; i3++)
    for (i4 = 1; i4 <= count; i4++)
    for (i5 = 1; i5 <= count; i5++)
    for (i6 = 1; i6 <= count; i6++)
    for (i7 = 1; i7 <= count; i7++)
    for (i8 = 1; i8 <= count; i8++)
    for (i9 = 1; i9 <= count; i9++)
    if (i0+i1+i2+i3+i4+i5+i6+i7+i8+i9==n)
    {
        result++;
    }

    printf("%d", result);

    if (!result)
    {
        return 0;
    }

    for (i0 = 1; i0 <= count; i0++)
    for (i1 = 1; i1 <= count; i1++)
    for (i2 = 1; i2 <= count; i2++)
    for (i3 = 1; i3 <= count; i3++)
    for (i4 = 1; i4 <= count; i4++)
    for (i5 = 1; i5 <= count; i5++)
    for (i6 = 1; i6 <= count; i6++)
    for (i7 = 1; i7 <= count; i7++)
    for (i8 = 1; i8 <= count; i8++)
    for (i9 = 1; i9 <= count; i9++)
    if (i0+i1+i2+i3+i4+i5+i6+i7+i8+i9==n)
        printf("\n%d %d %d %d %d %d %d %d %d %d",
            i0, i1, i2, i3, i4, i5, i6, i7, i8, i9);

    return 0;
}
